<template>
  <div>
    <!-- 三级分类导航 -->
    <TypeNav />
    <!-- 列表 -->
    <ListContainer />
    <!-- 今日推荐 -->
    <Recommend />
    <!-- 商品排行 -->
    <Rank />
    <!-- 喜欢 -->
    <Like />
    <!-- 楼层 -->
    <Floor
      v-for="(floor, index) in homeFloorsList"
      :key="index"
      :floor="floor"
    />
    <!-- 商标 -->
    <Brand />
  </div>
</template>

<script>
import TypeNav from '@/components/TypeNav'
import ListContainer from './ListContainer'
import Recommend from './Recommend'
import Rank from './Rank'
import Like from './Like'
import Floor from './Floor'
import Brand from './Brand'
// 引入获取floors数据的函数
import { reqGetHomeFloorsList } from '@/api/home'

export default {
  name: 'MyHome',
  async mounted() {
    this.homeFloorsList = await reqGetHomeFloorsList()
  },
  data() {
    return {
      // 首页楼层数据
      homeFloorsList: []
    }
  },
  components: { ListContainer, Recommend, Rank, Like, Floor, Brand, TypeNav }
}
</script>
